//
//  HMEmoticon.swift
//  01-表情
//
//  Created by mac on 15/10/25.
//  Copyright © 2015年 itheima. All rights reserved.
//

import UIKit

class HMEmoticon: NSObject {
    /// 向服务器发送的字符串名称
    var chs: String?
    /// 在本地显示的图片名称
    var png: String?
    // 拼接图片路径
    var imagePath:String {
        if png == nil {
            return ""
        }
        return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }
    /// 字符串编码
    var code: String? {
        didSet{
            emoji = code?.emoji
        }
    }
    var emoji: String?
    var isRemoved = false
    var isBlank = false
    
    init(isRemoved:Bool) {
        self.isRemoved = isRemoved
    }
    init(isBlank:Bool) {
        self.isBlank = isBlank
    }
    init(dict: [String: AnyObject]){
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    override var description: String{
       let keys = ["chs","png","code"]
        return dictionaryWithValuesForKeys(keys).description
    }
}
